import {USER_CREATE, MAIN, CART} from "./types"; //这款换成你自己的地址

export const userCreate = (userInfo) => ({
    type: USER_CREATE,
    userInfo
});


function action(type, payload = {}) {
    return {type, payload}
}

export const main = {
    changeTab: (tab) => action(MAIN.changeTab, {selectedTab: tab})
};

export const cart = {
    allToggleCheck: (goods) => action(CART.allToggleCheck, {goods}),
    toggleCheck: (payload) => action(CART.allToggleCheck, payload),
    getList: (dataList) => action(CART.getList, {dataList})
};
